<?php

namespace App\Http\Requests;


class UserRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, mixed>
     */
    public function rules()
    {
        return [
            'phone' => 'required|regex:/^1[3456789]\d{9}$/',
            'code' => 'required|size:6',
            'password' => 'required|min:6|max:20'
        ];
    }


    public function attributes(): array
    {
        return [
            'phone' => '手机号',
            'code' => '验证码',
            'password' => '密码'
        ];
    }
}
